package pl.olsson.plugin;

import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;
import org.apache.maven.plugin.AbstractMojo;

/**
 * @author nilols
 * @goal list
 * @phase generate-sources
 * @execute phase="process-resources"
 */
public class ListMojo extends AbstractMojo {

    @Override
    public void execute() {
        ScriptEngineManager manager = new ScriptEngineManager();
        for (ScriptEngineFactory factory: manager.getEngineFactories()) {
            getLog().info("\tEngine name\t : "+factory.getEngineName()+"\n"
                    +"\tEngine version\t : "+factory.getEngineVersion()+"\n"
                    +"\tLanguage name\t : "+factory.getLanguageName()+"\n"
                    +"\tLanguage version : "+factory.getLanguageVersion()+"\n"
                    +"\tExtensions\t : "+factory.getExtensions()+"\n"
                    +"\tMime types\t : "+factory.getMimeTypes()+"\n"
                    +"\tNames\t\t : "+factory.getNames()+"\n");
        }
    }
    
}
